import AJAX from '@/utils/ajax'

// 人气处理
class Hits {
  constructor() {
    if ($('.detail-hits').get(0)) {
      $('.detail-hits').each(function(i) {
        const val = $('.detail-hits').eq(i)
        AJAX({ url: 'hits', data: { id: val.data('id'), sid: val.data('sid'), type: val.data('type') } }).then(res => {
          console.log(res)
        })
      })
    }
  }
}

export default Hits
